package com.bwie.controller;

import com.bwie.domain.Coupon;
import com.bwie.service.CouponService;
import com.bwie.utils.R;
import com.bwie.vo.CouponVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import org.springframework.beans.factory.annotation.Autowired;

/**
 * (t_coupon)表控制层
 *
 * @author xxxxx
 */
@RestController
@RequestMapping("/coupon/t_coupon")
@Api(tags = {"优惠劵控制"})
public class CouponController {
    /**
     * 服务对象
     */
    @Autowired
    private CouponService couponService;

    @PostMapping("selectPageOfCoupon")
    @ApiOperation("查询优惠劵列表分页")
    public R selectPageOfCoupon(@RequestBody CouponVo souponVo) {
        return couponService.selectPageOfCoupon(souponVo);
    }

    @PostMapping("AddCoupon")
    @ApiOperation("新增优惠劵")
    public R AddCoupon(@RequestBody Coupon coupon){
        return couponService.AddCoupon(coupon);
    }
}
